<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>展示</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<?php echo ADMIN_LAYUI_URL; ?>css/layui.css"  media="all">
    <style>
        .Pagination a:hover,.current{background-color: #f54281;border: 1px solid #f54281;color: #ffffff; }
        .Pagination{float: right;height: auto;_height: 45px; line-height: 20px;margin-right: 15px;_margin-right: 5px; color:#565656;margin-top: 10px;_margin-top: 20px; clear:both;}
        .Pagination a,.Pagination span{ font-size: 14px;text-decoration: none;display: block;float: left;color: #565656;border: 1px solid #ccc;height: 34px;line-height: 34px;margin: 0 2px;width: 34px;text-align: center;}
    </style>
</head>
<body>

<table class="layui-table">
    <colgroup>
        <col width="150">
        <col width="150">
        <col width="200">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>文件空间</th>
        <th>文件名</th>
        <th>文件路径</th>
        <th>文件类型</th>
        <th>修改次数</th>
        <th>修改时间</th>
        <th colspan="2">操作</th>
    </tr>
    </thead>
    <tbody>
    <?php if(is_array($infos)): foreach($infos as $k=>$v): ?><tr>
        <td><?php echo ($v["co_space"]); ?></td>
        <td><?php echo ($v["co_name"]); ?></td>
        <td><?php echo ($v["co_path"]); ?></td>
        <td><?php echo ($v["co_type"]); ?></td>
        <td><?php echo ($v["co_time"]); ?></td>
        <td><?php echo ($v["last_time"]); ?></td>
        <td><div class="site-demo-button" id="LAY_demo"  style="margin-bottom: 0;">
            <button data-method="notice" id="<?php echo ($v["co_id"]); ?>" value="<?php echo ($v["co_name"]); ?>" class="layui-btn">编辑</button>
        </div></td>
        <td><button class="layui-btn layui-btn-danger" onclick="window.location.href='/cloud/index.php/Admin/Code/del/co_id/<?php echo ($v["co_id"]); ?>'">删除</button></td>
    </tr><?php endforeach; endif; ?>
</table>

<div id="demo1">
    <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-0">
        <?php echo ($page); ?>
    </div>
</div>

<script src="<?php echo ADMIN_LAYUI_URL; ?>layui.js" charset="utf-8"></script>
<script src="<?php echo (SITE_PATH); ?>Public/jquery/jquery.min.js"></script>

<script>

    var co_id;
    var co_name;

    layui.use('layer', function(){ //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
        //触发事件
        var active = {
            notice: function(){
                //示范一个公告层
//                console.log(co_id);
                parent.layer.open({
                    type: 2
                    ,title: co_name //不显示标题栏
                    ,closeBtn: 1
                    ,area: ['80%', '70%']
                    ,shadeClose: true
                    ,shade: false  //背景透明度
                    ,maxmin: true //最大化
                    ,id: co_id //设定一个id，防止重复弹出
//                    ,btn: ['确认', '取消']
                    ,moveType: 0 //拖拽模式，0或者1
                    ,content: '/cloud/index.php/Admin/Code/index/co_id/'+co_id
//                    ,success: function(layero){
//                        var btn = layero.find('.layui-layer-btn');
//                        btn.css('text-align', 'center');
//                        btn.find('.layui-layer-btn0').attr({
//                            href: ''
//                            ,target: '_self'
//                        });
//                    }
                });
            }
        };

        $('#LAY_demo .layui-btn').on('click', function(){
            co_id = $(this).attr("id");
            co_name = $(this).attr("value");
//            console.log(co_name);
            var othis = $(this), method = othis.data('method');
            active[method] ? active[method].call(this, othis) : '';

        });

    });

//    $('#new').on('click', function(){
//        parent.layer.msg('Hi, man', {shade: 0.3});
//    });

</script>

</body>
</html>